﻿using System;

namespace Xwltz.Net.Tools.Browser
{
    public class Safari : BaseBrowser
    {
        public Safari(string agent)
        {
            var agent1 = agent.ToLower();
            var safari = BrowserType.Safari.ToString().ToLower();

            if (!agent1.Contains(safari)) return;
            var first = agent1.IndexOf(safari, StringComparison.Ordinal);
            var version = agent1.Substring(first + safari.Length + 1);
            Version = ToVersion(version);
            Type = BrowserType.Safari;
        }
    }
}
